<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>继承</title>
		
	</head>
	<body>
		<div id="a">
			
		</div>
		<script type="text/javascript">
			function Person(){
				
			}
			Person.prototype.name="张三";
			Person.prototype.chinese=98;
			Person.prototype.math=80;
			Person.prototype.age=25;
			Person.prototype.name1=function(){
				return this.name;
			}
			Person.prototype.chinese1=function(){
				return this.chinese;
			}
			Person.prototype.math1=function(){
				return this.math;
			}
			Person.prototype.age1=function(){
				return this.age;
			}
			function Student(){
				
			}
			Student.prototype=new Person();//继承
			Student.prototype.show=function(){
				return "姓名:"+this.name1()+"<br/>"+"语文:"+this.chinese1()+"<br/>数学:"+this.math1()+"<br/>年龄:"+this.age1();
			}
			var aa=new Student();
			a.innerHTML=aa.show();
		</script>
	</body>
	
</html>
